package keter.ssh.hosts;

import java.util.List;

import com.google.common.collect.Lists;
import com.jfinal.kit.Prop;

import keter.ssh.model.Host;

public class SimpleFetcher implements Fetcher {

	@Override
	public List<Host> getHosts(Prop prop){
    	String[] addrs = prop.get("host.addrs").split(",");
    	List<Host> hosts = Lists.newArrayList();
    	for (String addr : addrs) {
			Host host = new Host(
				addr,
				prop.get("host.user"),
				prop.get("host.password")
			);
			hosts.add(host);
		}
    	return hosts;
}

}
